package com.yingside.io.io;

import java.io.IOException;
import java.io.StringReader;

public class TestStringReader {
    public static void main(String[] args) {
        String str = "abcdefg";
        StringReader sr = new StringReader(str);

        int n = -1;

        try {
            while((n = sr.read()) != -1){
                System.out.println("n = " + n);
            }
        } catch (IOException e) {
            e.printStackTrace();
        } finally {
            sr.close();
        }
    }
}
